/**
 *
 */
package com.vivi.codereview.actors;

import java.util.List;
import java.util.Set;
import java.util.TreeSet;

/**
 * The concept of this actor is to check the checkins done on given streams, and to compare with list of reviews, to highlight checkins without CodeReview. To do that, we will first list of checkins done in hotel package in integrations streams, then
 * @author nvillard
 *
 */
public class CheckinCheckerActor extends BaseActor {

  //private static final String CC_CHECKINS_CMD = "cleartool find . -ver 'version(\main\jcp_main_be_root\jcp_v17.0_be_root\jcp_v17.0_be_int\LATEST) && created_since(01-Aug-2013)' -print";
  private static final String CC_CHECKINS_CMD = "cleartool find . -ver 'version(\\main\\jcp_main_be_root\\{0}\\{1}\\LATEST) && created_since({1})' -print";

  @Override
  public String getName() {
    return "Checkin checker";
  }

  @Override
  public int process() throws Exception {
    List<String> releases = getListReleases();
    Set<String> reviewedFiles = getReviewedFiles();
    Set<String> notReviewedCheckins = new TreeSet<String>();
    for (String release : releases) {
      Set<String> checkinnedFiles = getCheckinnedFiles(release);
      Set<String> notReviewedCheckinsRelease = compareCheckinnedAndReviewedFiles(reviewedFiles, checkinnedFiles);
      notReviewedCheckins.addAll(notReviewedCheckinsRelease);
    }
    considerNotReviewedFiles(notReviewedCheckins);
    return 0;
  }

  private void considerNotReviewedFiles(Set<String> notReviewedCheckins) {
    // TODO Auto-generated method stub

  }

  private Set<String> compareCheckinnedAndReviewedFiles(Set<String> reviewedFiles, Set<String> checkinnedFiles) {
    // TODO Auto-generated method stub
    return null;
  }

  private Set<String> getCheckinnedFiles(String release) {
    // TODO Auto-generated method stub
    return null;
  }

  private Set<String> getReviewedFiles() {
    // TODO Auto-generated method stub
    return null;
  }

  private List<String> getListReleases() {
    // TODO Auto-generated method stub
    return null;
  }

}
